/**
 * 
 */
package com.arx.script;

import com.arx.interactive.InteractiveObject;
import com.arx.script.flyweight.ScriptObject;

/**
 * @author Donald
 */
public interface ScriptBase {
	/**
	 * Adds a group to an {@link InteractiveObject}.
	 * @param io the {@link InteractiveObject}
	 * @param group the name of the group
	 */
	void ARX_IOGROUP_Add(InteractiveObject io, String group);
	/**
	 * Removes all groups from an {@link InteractiveObject}.
	 * @param io the {@link InteractiveObject}
	 */
	void ARX_IOGROUP_Release(InteractiveObject io);
	/**
	 * Removes an {@link InteractiveObject} from a specific group.
	 * @param io the {@link InteractiveObject}
	 * @param group the name of the group
	 */
	void ARX_IOGROUP_Remove(InteractiveObject io, String group);
	/**
	 * Computes shortcuts within a {@link ScriptObject}.
	 * @param es the {@link ScriptObject}
	 */
	void ARX_SCRIPT_ComputeShortcuts(ScriptObject es);
	/**
	 * Count the number of active script timers.
	 * @return int
	 */
	long ARX_SCRIPT_CountTimers();
	/** Clears the event stack. */
	void ARX_SCRIPT_EventStackClear();
	/**
	 * Clears the event stack for a specific {@link InteractiveObject}.
	 * @param io the {@link InteractiveObject}
	 */
	void ARX_SCRIPT_EventStackClearForIo(InteractiveObject io);
	/**
	 * Executes all stacked events, regardless of the max allowed with the stack
	 * flow.
	 */
	void ARX_SCRIPT_EventStackExecuteAll();
	/**
	 * Initializes the event stack, filling it with empty events.
	 * @throws Exception if an error occurs
	 */
	void ARX_SCRIPT_EventStackInit() throws Exception;
	/** Frees all global variables. */
	void ARX_SCRIPT_Free_All_Global_Variables();
	void ARX_SCRIPT_ReleaseLabels(final ScriptObject es);
	void ARX_SCRIPT_SetVar(InteractiveObject io, String name, String content);
	void ARX_SCRIPT_AllowInterScriptExec();
	int ARX_SCRIPT_GetSystemIOScript(InteractiveObject io, String name);
	/**
	 * Gets the next word.
	 * @param es
	 * @param i
	 * @param temp
	 * @return
	 */
	int GetNextWord(ScriptObject es, int i, String temp);
	/**
	 * Gets the next word
	 * @param es
	 * @param i
	 * @param temp
	 * @param flags
	 * @return
	 */
	int GetNextWord(ScriptObject es, int i, String temp, long flags);
	/**
	 * Initializes a {@link ScriptObject}.
	 * @param es the {@link ScriptObject}
	 */
	void InitScript(ScriptObject es);
	byte SendIOScriptEvent(InteractiveObject io, long msg, String params,
			String eventname);
	/**
	 * Sends a script event.
	 * @param es
	 * @param msg
	 * @param params
	 * @param io
	 * @param evname
	 * @param info
	 * @return
	 */
	byte SendScriptEvent(ScriptObject es, int msg, String params,
			InteractiveObject io, String evname, int info);
	/**
	 * Checks if a string (seek) is at the start of another string (text).
	 * @param text the full text being checked
	 * @param seek the string being sought
	 * @return true if the string (seek) is at the start of another string
	 *         (text); false otherwise
	 */
	boolean specialstrcmp(String text, String seek);
	/**
	 * Sends an IO script event to the stack.
	 * @param io
	 * @param msg
	 * @param params
	 * @param eventname
	 */
	void Stack_SendIOScriptEvent(InteractiveObject io, long msg, String params,
			String eventname);
}
